* @since 1.16.3
* @param Revision $rev
* @param bool $isPublic Show only if all users can see it
+ * @param bool $useParentheses (optional) Wrap comments in parentheses where needed
* @return string HTML
*/
- public static function revUserTools( $rev, $isPublic = false ) {
+ public static function revUserTools( $rev, $isPublic = false, $useParentheses = true ) {
if ( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
$link = wfMessage( 'rev-deleted-user' )->escaped();
} elseif ( $rev->userCan( Revision::DELETED_USER ) ) {
$userId = $rev->getUser( Revision::FOR_THIS_USER );
$userText = $rev->getUserText( Revision::FOR_THIS_USER );
$link = self::userLink( $userId, $userText )
- . self::userToolLinks( $userId, $userText );
+ . self::userToolLinks( $userId, $userText, false, 0, null,
+ $useParentheses );
} else {
$link = wfMessage( 'rev-deleted-user' )->escaped();
}
if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
- return ' <span class="history-deleted">' . $link . '</span>';
+ return ' <span class="history-deleted mw-userlink">' . $link . '</span>';
}
return $link;
}
$block = " <span class=\"comment\">" . wfMessage( 'rev-deleted-comment' )->escaped() . "</span>";
}
if ( $rev->isDeleted( Revision::DELETED_COMMENT ) ) {
- return " <span class=\"history-deleted\">$block</span>";
+ return " <span class=\"history-deleted comment\">$block</span>";
}
return $block;
}
$stxt = wfMessage( 'historyempty' )->escaped();
} else {
$stxt = wfMessage( 'nbytes' )->numParams( $size )->escaped();
- $stxt = wfMessage( 'parentheses' )->rawParams( $stxt )->escaped();
}
- return "<span class=\"history-size\">$stxt</span>";
+ return "<span class=\"history-size mw-diff-bytes\">$stxt</span>";
}
/**
static function splitTrail( $trail ) {
$regex = MediaWikiServices::getInstance()->getContentLanguage()->linkTrail();
$inside = '';
- if ( $trail !== '' ) {
- $m = [];
- if ( preg_match( $regex, $trail, $m ) ) {
- $inside = $m[1];
- $trail = $m[2];
- }
+ if ( $trail !== '' && preg_match( $regex, $trail, $m ) ) {
+ list( , $inside, $trail ) = $m;
}
return [ $inside, $trail ];
}
$attrs = [
'data-mw' => 'interface',
- 'title' => $context->msg( 'tooltip-rollback' )->text(),
- 'data-rollback-count' => (int)$editCount
+ 'title' => $context->msg( 'tooltip-rollback' )->text()
];
$options = [ 'known', 'noclasses' ];